<?php

namespace App\Plugins\Article\Requests;

use App\Http\Requests\Request;

class Article extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required',
            'content' => 'required|max:5000',
        ];

    }
    // 重写消息
    public function messages(){
        return [
            'title.required' => '请输入文章标题！',
            'content.required'  => '请您输入文章内容，并保证在5000个字符以内。',
        ];
    }
}
